home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Term / Extras / Source / term-source.lha / xproto.h < prev    next >
C/C++ Source or Header  |  1996-10-20  |  6KB  |  148 lines

  1. /** xproto.h
  2. *
  3. *   Include file for External Protocol Handling
  4. *
  5. **/
  6.  
  7. #ifndef _COMPILER_H
  8. #define REG(x) register __ ## x
  9. #define ASM __asm
  10. #endif    /* _COMPILER_H */
  11.  
  12. /*
  13. *   Number of defined extensions
  14. */
  15. #define XPR_EXTENSION 4L
  16.  
  17. /*
  18. *   Flags returned by XProtocolSetup()
  19. */
  20. #define XPRS_FAILURE    0x00000000L
  21. #define XPRS_SUCCESS    0x00000001L
  22. #define XPRS_NORECREQ   0x00000002L
  23. #define XPRS_NOSNDREQ   0x00000004L
  24. #define XPRS_HOSTMON    0x00000008L
  25. #define XPRS_USERMON    0x00000010L
  26. #define XPRS_HOSTNOWAIT 0x00000020L
  27. /*
  28. *   The update structure
  29. */
  30. struct XPR_UPDATE {     ULONG  xpru_updatemask;
  31.                         STRPTR xpru_protocol;
  32.                         STRPTR xpru_filename;
  33.                         LONG   xpru_filesize;
  34.                         STRPTR xpru_msg;
  35.                         STRPTR xpru_errormsg;
  36.                         LONG   xpru_blocks;
  37.                         LONG   xpru_blocksize;
  38.                         LONG   xpru_bytes;
  39.                         LONG   xpru_errors;
  40.                         LONG   xpru_timeouts;
  41.                         LONG   xpru_packettype;
  42.                         LONG   xpru_packetdelay;
  43.                         LONG   xpru_chardelay;
  44.                         STRPTR xpru_blockcheck;
  45.                         STRPTR xpru_expecttime;
  46.                         STRPTR xpru_elapsedtime;
  47.                         LONG   xpru_datarate;
  48.                         LONG   xpru_reserved1;
  49.                         LONG   xpru_reserved2;
  50.                         LONG   xpru_reserved3;
  51.                         LONG   xpru_reserved4;
  52.                         LONG   xpru_reserved5;
  53.                    };
  54. /*
  55. *   The possible bit values for the xpru_updatemask are:
  56. */
  57. #define XPRU_PROTOCOL           0x00000001L
  58. #define XPRU_FILENAME           0x00000002L
  59. #define XPRU_FILESIZE           0x00000004L
  60. #define XPRU_MSG                0x00000008L
  61. #define XPRU_ERRORMSG           0x00000010L
  62. #define XPRU_BLOCKS             0x00000020L
  63. #define XPRU_BLOCKSIZE          0x00000040L
  64. #define XPRU_BYTES              0x00000080L
  65. #define XPRU_ERRORS             0x00000100L
  66. #define XPRU_TIMEOUTS           0x00000200L
  67. #define XPRU_PACKETTYPE         0x00000400L
  68. #define XPRU_PACKETDELAY        0x00000800L
  69. #define XPRU_CHARDELAY          0x00001000L
  70. #define XPRU_BLOCKCHECK         0x00002000L
  71. #define XPRU_EXPECTTIME         0x00004000L
  72. #define XPRU_ELAPSEDTIME        0x00008000L
  73. #define XPRU_DATARATE           0x00010000L
  74. /*
  75. *   The xpro_option structure
  76. */
  77. struct xpr_option {
  78.    STRPTR xpro_description;      /* description of the option                  */
  79.    LONG   xpro_type;             /* type of option                             */
  80.    STRPTR xpro_value;            /* pointer to a buffer with the current value */
  81.    LONG   xpro_length;           /* buffer size                                */
  82. };
  83. /*
  84. *   Valid values for xpro_type are:
  85. */
  86. #define XPRO_BOOLEAN 1L         /* xpro_value is "yes", "no", "on" or "off"   */
  87. #define XPRO_LONG    2L         /* xpro_value is string representing a number */
  88. #define XPRO_STRING  3L         /* xpro_value is a string                     */
  89. #define XPRO_HEADER  4L         /* xpro_value is ignored                      */
  90. #define XPRO_COMMAND 5L         /* xpro_value is ignored                      */
  91. #define XPRO_COMMPAR 6L         /* xpro_value contains command parameters     */
  92.  
  93.     /* Structure forward declaration for the GNU `C' compiler. */
  94.  
  95. #ifdef __GNUC__
  96. struct Buffer;
  97. #endif    /* __GNUC__ */
  98.  
  99. /*
  100. *   The structure
  101. */
  102. struct XPR_IO {
  103.                 STRPTR        xpr_filename;
  104.                   LONG (* ASM xpr_fopen)(REG(a0) STRPTR,REG(a1) STRPTR);
  105.                   LONG (* ASM xpr_fclose)(REG(a0) struct Buffer *);
  106.                   LONG (* ASM xpr_fread)(REG(a0) APTR,REG(d0) LONG,REG(d1) LONG,REG(a1) struct Buffer *);
  107.                   LONG (* ASM xpr_fwrite)(REG(a0) APTR,REG(d0) LONG,REG(d1) LONG,REG(a1) struct Buffer *);
  108.                   LONG (* ASM xpr_sread)(REG(a0) APTR,REG(d0) ULONG,REG(d1) ULONG);
  109.                   LONG (* ASM xpr_swrite)(REG(a0) APTR,REG(d0) LONG);
  110.                   LONG (*     xpr_sflush)(VOID);
  111.                   LONG (* ASM xpr_update)(REG(a0) struct XPR_UPDATE *);
  112.                   LONG (*     xpr_chkabort)(VOID);
  113.                   LONG (*     xpr_chkmisc)(VOID);
  114.                   LONG (* ASM xpr_gets)(REG(a0) STRPTR,REG(a1) STRPTR);
  115.                   LONG (* ASM xpr_setserial)(REG(d0) LONG);
  116.                   LONG (* ASM xpr_ffirst)(REG(a0) STRPTR,REG(a1) STRPTR);
  117.                   LONG (* ASM xpr_fnext)(REG(d0) LONG,REG(a0) STRPTR,REG(a1) STRPTR);
  118.                   LONG (* ASM xpr_finfo)(REG(a0) STRPTR,REG(d0) LONG);
  119.                   LONG (* ASM xpr_fseek)(REG(a0) struct Buffer *,REG(d0) LONG,REG(d1) LONG);
  120.                   LONG        xpr_extension;
  121.                   LONG       *xpr_data;
  122.                  ULONG (* ASM xpr_options)(REG(d0) LONG,REG(a0) struct xpr_option **);
  123.                   LONG (* ASM xpr_unlink)(REG(a0) STRPTR);
  124.                   LONG (*     xpr_squery)(VOID);
  125.                   LONG (* ASM xpr_getptr)(REG(d0) LONG);
  126.               };
  127.  
  128. /*
  129. *   The functions
  130. */
  131.  
  132. LONG XProtocolCleanup(struct XPR_IO *);
  133. LONG XProtocolSetup(struct XPR_IO *);
  134. LONG XProtocolSend(struct XPR_IO *);
  135. LONG XProtocolReceive(struct XPR_IO *);
  136. LONG XProtocolHostMon(struct XPR_IO *,APTR,LONG,LONG);
  137. LONG XProtocolUserMon(struct XPR_IO *,APTR,LONG,LONG);
  138.  
  139. /* Pragmas for SAS/Lattice-C V5.0 */
  140. #ifndef NO_PRAGMAS
  141. #pragma libcall XProtocolBase XProtocolCleanup 1e 801
  142. #pragma libcall XProtocolBase XProtocolSetup 24 801
  143. #pragma libcall XProtocolBase XProtocolSend 2a 801
  144. #pragma libcall XProtocolBase XProtocolReceive 30 801
  145. #pragma libcall XProtocolBase XProtocolHostMon 36 109804
  146. #pragma libcall XProtocolBase XProtocolUserMon 3c 109804
  147. #endif    /* NO_PRAGMAS */
  148.